package com.tj.mapper;

import com.tj.pojo.Employee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author t
* @description 针对表【employee(员工信息)】的数据库操作Mapper
* @createDate 2023-04-25 21:48:54
* @Entity com.tj.pojo.Employee
*/
@Mapper
public interface EmployeeMapper {

    @Select("select * from employee where id=#{id}")
    public Employee getById(int id);

    @Select("select * from employee where username=#{username}")
    public Employee getByUsername(Employee employee);

    @Insert("insert into employee values (null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    public int addEmployee(Employee employee);

    @Select(("select * from employee limit #{page},#{pageSize}"))
    public List<Employee> getPageEmployee(int page,int pageSize,String name);

    public int updateEmployee(Employee employee);
}




